This plug-in has a simple and cross platform way to execute a script when data has been received. This is done via a Dispatch Script. If you want this functionality you need to implement the Dispatch functions in
your own database. See Scriptmaker steps in this file how this can be done.
Set the port preference and caller ID preference once to create the settings appropiate for your computer and serial port and the modem/adapter you are using.
Press on the "Start CallerID" script. This t
ells the plug-in that the Dispatch Script can be called from the keyboard with control-1
(Windows) or command-1 (Mac).
This is what happens when data arrives:
- the plug-in will bring the database file to the front and simulate a press on the keyboard:control-1(Windows) or command-1(Mac)
- this will start the Dispatch Script, which can handle the receiving of the data.
NOTE You can still use the Dispatch Script for other actions, so this doesn't cost a place in the script menu. That's whC
y we call it Dispatch Scripting: when called it determines if it was called because there was data received and if yes it will dispatch the processing to another script.
Caller ID
Set Caller ID Preferences
V1This file implements CallerID via the Serial Port
CallerID Menu
Set Port Preferences
1999 Troi Automatisering
Start CallerID
To Main Menu
CallerID listB
2A!Caller ID
Serial Port Preferences
51This file implements CallerID via the Serial Port
1999 Troi Automatisering
Set Port Preferences
speed
E port name
G stop bits
I data bits
parity
standard flow control
advanced flow control
PA-TIP Only use advanced control if you need to.
flow control
Set Caller ID Preferences
CallerID Menu
Start CallerID
To Main Menu
Preferences CallerIDB
error codep
CallerID List
CallerID
Set Caller ID Preferences
CallerID Menu
Set Port
Preferences
(re)start CallerID
To Main Menu
Creation Date/Time
to detailed list
EA!name from related person.fp3 file
CallerID detail listB
+A>Known Modem Strings and Keywords Choose a modem and press set
Normally a modem must be initialised so that it returns the CallerID. The actual initialisation string varies per modem type. Here are 2 examples:
begin keyword
end keyword
Caller ID
Caller ID Preferences
51This file implements CallerID via the Serial Port
1999 Troi Automatisering
Set Port Preferences
Set Caller ID Preferences
CallerID Menu
Start CallerID
To Main Menuinitialisation string varies per modem type. Here are 2 examples:
begin keyword
end keyword
Caller ID
Caller ID Preferences
51This file implements CallerID via the Serial Port
1999 Troi Automatisering
Set Port Preferences
Set Caller ID Preferences
CallerID Menu
Start CallerID
To Main Menu
`4Add RETURN to send commands (needed for most modems)
eCWith the keywords as given above the script expects data like this:
ABHB>>
gAcModem Type Initialisation String
USR sportster 28800 AT#cls=8#cid=1<CR>
Dynalink IS 128AE AT#C1<CR>
Parse String
When the phone rings and the data that is sent to the computer is parsed by a script
Parse CallerID
to get the telephone number. We assumed here that there is a begin and an end keyword.
Set init/keywords
Modem Initialisation String
qA&NOTE The script removes extra returns.
all fieldsB
error codep
CallerID List
CallerID
Set Caller ID Preferences
CallerID Menu
Set Port
Preferences
(re)start CallerID
To Main Menu
Creation Date/Time
Message Received
to compact list
Total Message History
23-02-1999
14:25:43
p 172426606
To Main Menu
To Dispatch Menu
To Preferences
To CallerID Preferences
----- General ------
%Check for Presence of Serial plug-in
)----- Caller ID Dispatch Scripting
------
$Set Known Modem strings and keywords
)Open Serial Port And Prepare for CallerID
Open Serial Port
Initialize the port
Set Dispatcher Script
Process Data Received
, Receive Data in global gTempResultReceived
CallerIDD
Creation DateF
Creation TimeH
MessReceived
gAddCRL
gAdvancedFlowControlN
gBeginKeywordP gCallerIDR
gCR CalcT gDataBitsV
gEndKeywordX
gErrorCodeZ
gFlowControl\
gKnownModemTypes^
gMessageReceived`
gMessageSendb
gMessFromBegind
gMessHistoryf
gModemInitStringh
gNumberj
gParityl gPortNamen
gPortNames Calcp
gSample CallerID Datar
gSpeedt gStopBitsv
gTempResultReceivedx
gTrue Calcz
gVersion Calc
Helvetica
Geneva
Arial
Times New Roman
Monaco
Courier
Times
Futura
Courier New
Palatino
Minion Web
New York
AppleGaramond Bk
AppleGaramond Lt
Open Serial Port
Open the serial portB!
] = ""
Cancel
First select a valid serial port name.l portB!
] = ""
Cancel
First select a valid serial port name.
To Main Menu
|("Serial-DataWasReceived"
Serial-DataWasReceived
A)----- Caller ID Dispatch Scripting
------
A%Check for Presence of Serial plug-in
A4Important: ALWAYS check if the plug-in is available!
|("Serial-Open"
] & "|" &
W & " " &
_ & " " &
` & " " &
a & " "&
Serial-Open
<> 0
= "$$-97"
$$-97
Cancelm
mPort is in useHw
Cancelm
mAn error occurred
Set all globals
|("Troi-Set Default Separator"
"|")
Troi-Set Default Separator
A Open file
) = 2
----- General ------
----- Misc ------
BeepBeep
Close Serial Port
Open the serial portB<
|("Serial-Close"
Serial-Close
To Preferences
B)Check if this is FileMaker 4.0 or higher.CQ
1)) < 4
Canceld
This file requires FileMaker 4.0 or higherE/Check if the Troi Grabber Plug-in is available.F|
|("Serial-Version"
"")
14 ) <> "Serial Plug-in"
Serial-Version
Serial Plug-in
) = 1
Canceld
The Serial Plug-in not found.
Please put The Serial Plug-in into the Extensions folder inside the FileMaker folder. Also enable all the plug-ins under the application preferences.
Canceld
The Serial Plug-in not found. Please put the this Plug-in into the SYSTEM directory inside the FileMaker directory.
Also enable all the plug-ins under the application preferences.
Set Dispatcher Script
|("Serial-SetDispatchScript"
) & "| scriptkey=1")
Serial-SetDispatchScript
| scriptkey=1
Process Data Received
C#Get the data into the global field.D&Add it to the global gMessageReceived.E$
F1Also save all this data in the global gHistory...G-...Nice for analysing the data coming in. ...H"...You may not really need this...I)...then just remove the next script step.J,Now see what data has come in and act on it.
ipt step.
A, Receive Data in global gTempResultReceived
|("Serial-Receive"
Serial-Receive
2 ) = "$$"
^ = "$$-28"
$$-28
Cancel
Open the port firstE-
^ = "$$-207"
$$-207
Cancel
Buffer overflow error.Gx
Cancel
An error occurred!
Reset Dispatcher Script
ow see what data has come in and act on it.KR
|("Serial-RestoreSituation"
Serial-RestoreSituation
A)Open Serial Port And Prepare for CallerID
Open the serial portB
To Dispatch Menu
Parse CallerID
|("Serial-SetDispatchScript"
"")
Serial-SetDispatchScript
Whatever You Want
Do whatever you want to do....B
We only beep here...
Initialize the port
|("Serial-Send"
] & "|" &
Serial-Send
<> 0
= "$$-97"
$$-97
Cancelm
mPort is in useEw
Cancelm
mAn error occurred
To CallerID Preferences
A$Set Known Modem strings and keywords
A/This script tries to find the begin and end ...BB... of the Caller id data and then will get the number out of it. C-You may need to modify it for your situation.DGWe loop until there is no begin- and end keyword in the string anymore.EI
1 )
1 )
t >= 1
u >= 1
H4This might be a complete record.... get the CallerIDI?Get everything from the begin keyword to the end of the message
JHRemove all from the end keyword and store in the gCallerID global field.Kc
Get rid of (extraneous) returnsMf
1 ) -1)
f <> ""
P&Now we should have a complete callerIDQ
Create a record for it...R
7VDClean up gMessageReceived remove all till the end of the end keywordWL
Y9>X"You can now do what ever you want.Y
This script beeps.Z
Try again from the end keyword[L
Save History
A*Save all the data in the history global...B ...You may not really need this.CC
k) +
^) < 64000
E"Make some room at the beginning...FM
1000
k)) &
r ="Dynalink IS128AE"
Dynalink IS128AE
"AT#C1"
AT#C1C
"Yes"
YesD&
"Caller: "
Caller: E
"RING"
RINGFF
r ="USR Sportster 28800"
USR Sportster 28800
"AT#cls=8#cid=1"
AT#cls=8#cid=1H
"Yes"
YesI"
"NMBR ="
NMBR =J
"RING"
HRPTH
FPTHAHKES:Projecten:Troi FM Plug-In:GRAB:Troi-Grabber-Plug-in1.0a1:StudReg.fp3
MSPCA
NAMEA
StudReg.fp3
RPTHA
StudReg.fp3
StudReg.fp3
FMP3FMP3
Troi-Grabber-Plug-in1.0a1
HKES:Projecten:Troi FM Plug-In:GRAB:Troi-Grabber-Plug-in1.0a1:StudReg.fp3
Ethernet zone
McGee
peter
PRPTH
FPTHAPKES:Projecten:Troi FM Plug-In:GRAB:Troi-Grabber-Plug-in1.0a1:samples:StudReg.fp3
MSPCA
NAMEA
StudReg.fp3
RPTHA
:samples:StudReg.fp3
ONML""
ONML""
ONML""
NRPTH
FPTHANKES:Projecten:Troi FM Plug-In:GRAB:Troi-Grabber-Plug-in1.0b1:docs:Overview.fp3
MSPCA
NAMEA
Overview.fp3
RPTHA
:docs:Overview.fp3
Overview.fp3
FMP3FMP3
NKES:Projecten:Troi FM Plug-In:GRAB:Troi-Grabber-Plug-in1.0b1:docs:Overview.fp3
C#Get the data into the global field.D&Add it to the global gMessageReceived.E$
F1Also save all this data in the global gHistory...G-...Nice for analysing the data coming in. ...H"...You may not really need this...I)...then just remove the next script step.J,Now see what data has come in and act on it.